package com.example.demoelasticjob.jobs;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.springframework.stereotype.Component;

@Component
public class DemoJob implements SimpleJob {

    @Override
    public void execute(ShardingContext shardingContext) {
        System.out.println("jobName:" + shardingContext.getJobName());
        System.out.println("taskId:" + shardingContext.getTaskId());
        System.out.println("shardingTotalCount:" + shardingContext.getShardingTotalCount());
        System.out.println("shardingItem:" + shardingContext.getShardingItem());
        System.out.println("jobParameter:" + shardingContext.getJobParameter());
        System.out.println("shardingParameter:" + shardingContext.getShardingParameter());
        System.out.println("task completed!");
    }

}
